/**
 * Created by DevilsEyes on 2016/3/14.
 */
'use strict';

define(['text!path/_SEED_/tmp.html'], function (page) {

    var render = template.compile(page);

    var apiList = {
        getInfo: api + 'homepage'
    };

    var vm = new Page.creat({
        $id: '_SEED_',
        $model: {
            data: {},
            $: {},
            init: function () {

                //$.ajax({
                //    url: '../testData/homepage.json',
                ex.jsonp({
                    url: apiList.getInfo,
                    success: function (obj) {
                        console.log(obj);

                        vm.data = {};

                        $('#page').html(render(vm.data));

                        ex.async(function () {

                            vm.bindEvent(vm.event);
                            vm.bind$(vm.$);

                        });

                    }
                })
            },
            event: {}
        }
    });


    return {
        init: function () {
            vm.$init({
                setTitle: '_SEED_'
            });
            vm.init();
        }
    }
});